﻿using SheBao.EFDAL;
using SheBao.IDAL;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SheBao.DALFactory
{
    public class DbSession : IDbSession
    {

        #region 属性
        private IUserDal _userDal;

        public IUserDal UserDal
        {
            get
            {
                if (_userDal == null)
                {
                    _userDal = DalFactory.GetUserDal();
                }
                return _userDal;
            }

        }
        #endregion

        #region 行为
        public int SaveChanges()
        {
            return DbContextFactory.GetCurrentDbContext().SaveChanges();
        }
        #endregion

      
    }
}
